﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ADSTS_SERVER.Models
{
    /// <summary>
    /// 地图模型表
    /// </summary>
    [SugarTable("mapmodel", TableDescription = "地图模型表")]
    public class MapModel
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id", ColumnDescription = "主键ID")]
        public long Id { get; set; }

        /// <summary>
        /// 地图资源Url
        /// </summary>
        [SugarColumn(ColumnName = "mapurl", ColumnDataType = "text", ColumnDescription = "地图资源Url")]
        public string MapUrl { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [SugarColumn(ColumnName = "name", ColumnDescription = "名称")]
        public string Name { get; set; }

        /// <summary>
        /// 分类
        /// </summary>
        [SugarColumn(ColumnName = "tag", ColumnDescription = "分类")]
        public string Tag { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnName = "description", ColumnDescription = "描述")]
        public string Description { get; set; }

        /// <summary>
        /// 封面图Url
        /// </summary>
        [SugarColumn(ColumnName = "cover", ColumnDataType = "text", ColumnDescription = "封面图Url")]
        public string Cover { get; set; }

        /// <summary>
        /// 用户ID
        /// </summary>
        [SugarColumn(ColumnName = "uid", ColumnDescription = "用户ID")]
        public long UId { get; set; }

        /// <summary>
        /// 封面图Url
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public User User { get; set; }

        /// <summary>
        /// 是否激活数据 1-是 0-否
        /// </summary>
        [SugarColumn(ColumnName = "isactive", ColumnDescription = "是否激活数据 1-是 0-否")]
        public int IsActive { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "created", IsOnlyIgnoreUpdate = true)]
        public DateTime Created { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>        
        [SugarColumn(ColumnName = "updated")]
        public DateTime Updated { get; set; } = DateTime.Now;

    }
}
